package com.gqc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gqc.bean.Commodity;
import com.gqc.dao.CommodityMapper;

@Service
public class CommodityService {

	@Autowired
	CommodityMapper commodityMapper;

	public List<Commodity> queryBybusiness(String business) {

		return commodityMapper.selectBybusiness(business);

	}

	// 查询订单
	public List<Commodity> findCommodityByUsername(String username) {
		return commodityMapper.findCommodityByUsername(username);
	}

	// 删除订单
	public void deleteCommodityById(int id) {
		commodityMapper.deleteCommodityById(id);
	}

	// 新增订单
	public void insert(Commodity record) {
		record.setFlag(1);
		commodityMapper.insert(record);
	}

	// 修改订单
	public void updateByPrimaryKeySelective(Commodity record) {
		commodityMapper.updateByPrimaryKeySelective(record);
	}
}
